﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Input;

namespace WeChat.UI.View
{
    public class WindowBase : Window
    {
        public WindowBase()
        {
            WindowStyle = WindowStyle.None;
            ResizeMode = ResizeMode.NoResize;
            PreviewMouseMove += OnPreviewMouseMove;
        }

        private void OnPreviewMouseMove(object sender, MouseEventArgs e)
        {
            if (Mouse.LeftButton == MouseButtonState.Pressed)
            {
                DragMove();
            }
        }

        ~WindowBase()
        {
            PreviewMouseMove -= OnPreviewMouseMove;
        }
    }
}
